﻿Public Class PersonelMaasOzeti
	Inherits ProcessReport

	Dim ay, yil, iscidonem As Integer
	Dim donem, tarih As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Personel Maaş Özeti Raporu", "Rapor parametrelerini girin.")
				donem = AddCombo("donem", "Maaş Dönemi", Personel.MaasDonemleriSource, "width=20", "--first--")
				tarih = AddDate("tarih", "Ödeme tarihi", "nl")
				Landscape = True
			Case EventType.ValidateForm
				yil = Mid(donem.Get, 1, 4)
				ay = Mid(donem.Get, 5, 2)
				IsciDonem = Mid(donem.Get, 7, 1)
				Rs = Personel.MaasOzeti(Remote, Yil, Ay, IsciDonem)
				e.Result = True
			Case EventType.CoverPage
				Report.NoPageNumbers = True
				Report.PrintHeader("MAAŞ ÖZETLERİ RAPORU")
				Report.Indent = New Padding(6)
				Report.SetColumns("", "1;1", "l;r")
				Dim desc = yil & "/" & ay.n2 & " " & Choose(iscidonem, "1. Dönem İşçi", "2. Dönem İşçi + Personel")
				Report.Print("Yapılan ödeme: " & desc, "Ödeme tarihi: " & DMY(tarih.Get))
				Report.AddBookmark()
				Report.SetColumns("", "1;3;1;1;3;1", "c;l;m;c;l;m", "-")
				Report.Print("<cs=3><c>BORÇLU HESAPLAR", "<cs=3><c>ALACAKLI HESAPLAR")
				Report.AddBookmark()
				Report.Print("664.06.02", "MEMUR MAAŞLARI", Rs("maas"), "106.01.07", "S.S.FON HESABI", Rs("maas") - Rs("ssk") + Rs("ihsfon") - Rs("h1330101") - Rs("h3330101"))
				Report.Print("664.06.03", "MEMUR MAAŞLARI H.P. ÖD.", Rs("hp"), "133.01.01", "BORÇLU PERSONEL", Rs("h1330101"))
				Report.Print("664.04.01", "ARIZİ PERSONEL MAAŞLARI", 0, "133.02.01", "NAKİT VE KIYMET AÇK. BORÇ. PER.", 0)
				Report.Print("664.04.02", "ARIZİ PERSONEL H.P. ÖD.", 0, "351.03.01", "S.S. PRİMLERİ KESİNTİLERİ", Rs("ssk") + Rs("sskfon"))
				Report.Print("664.02.01", "SÖZLEŞMELİ PERSONEL MAAŞLARI", 0, "133.03.01", "SAİR İŞLEM BORÇLU PERSONEL", 0)
				Report.Print("664.21.01", "S.S. PRİMLERİ İŞVEREN KATKISI", Rs("sskfon"), "333.01.01", "PERSONEL ÖDENMEMİŞ İSTİHKAKLARI", Rs("h3330101"))
				Report.Print("664.21.01", "İHTİYAT SANDIĞI İŞVEREN KESİNTİLERİ", Rs("ihsfon"))
				Report.Print("664.06.06", "VEKALET AYLIĞI", 0)
				Report.AddBookmark()
				Report.Print("<cs=2>", Rs("maas") + Rs("sskfon") + Rs("ihsfon"), "<cs=2>", Rs("maas") + Rs("sskfon") + Rs("ihsfon"))
				Report.AddBookmark()
				Report.ResetIndent()
				Report.SkipLine(2)
				Report.PrintParagraph("Bordroda belirtilen personel maaşlarının ödenmesini saygılarımla arz ederim.")
				Report.SkipLine(2)
				Report.SetColumns("", "1;1;1", "c;c;c")
				Report.Print("Ödenmesi uygundur.", "", "Ödenmesi uygundur.")
				Report.SkipLine(3)
				Report.Print("Sosyal Sigortalar Dairesi Müdürü", "", "Sosyal Sigortalar Muhasebe Amiri (v)")
				Report.DrawRect(0, Report.Bookmark(1).Y, 1, Report.Bookmark(2).Y)
				Report.DrawRect(0, Report.Bookmark(2).Y, 1, Report.Bookmark(3).Y)
				Report.DrawRect(0, Report.Bookmark(3).Y, 1, Report.Bookmark(4).Y)
				Report.DrawRect(0, Report.Bookmark(1).Y, 0.5, Report.Bookmark(4).Y, 2)
				Report.DrawRect(0, Report.Bookmark(1).Y, 1, Report.Bookmark(4).Y, 2)
		End Select
	End Sub

End Class
